import Vue from 'vue'
import Router from 'vue-router'

import Home from '@/components/Home'

import RoleList from '@/components/core/permission/RoleList'
import PermissionTree from '@/components/core/permission/PermissionTree'
import PermissionList from '@/components/core/permission/PermissionList'
import Frame from '@/views/frame/Frame'
import Login from '@/views/Login'
import OrganizeTree from '@/components/core/organize/OrganizeTree'
import UserList from '@/components/core/user/UserList'
import OrgUserList from '@/components/core/organize/OrgUserList'
import RegisterUser from '@/views/RegisterUser'

import WeChatFrame from '@/views/frame/WeChatFrame'
import A1 from '@/components/weChat/a1'
import A2 from '@/components/weChat/a2'
import Message from '@/components/weChat/Message'
import My from '@/components/weChat/My'
import WeChatLogin from '@/components/weChat/WeChatLogin'
import Details from  '@/components/weChat/message/Details'
import WeChatRegister from  '@/components/weChat/WeChatRegister'

Vue.use(Router)

export default new Router({
     //mode: 'history',
    routes: [
        {
            path: '/',
            name: 'login',
            component: Login,
            children: [
                {
                    path: '/registerUser',
                    name: 'registerUser',
                    component: RegisterUser
                },
            ]
        },
        {
            path: '/weChatLogin',
            name: 'weChatLogin',
            component: WeChatLogin,
            children: [
                {
                    path: '/wechatRegisterUser',
                    name: 'wechatRegisterUser',
                    component: RegisterUser
                },
            ]
        },
        {
            path: '/index',
            name: 'index',
            component: Frame,
            children: [
                {
                    path: '/home',
                    name: 'home',
                    component: Home
                },
                {
                    path: '/core/permission/roleList',
                    name: 'roleList',
                    component: RoleList,
                    children: [
                        {
                            path: '/core/permission/permissionTree',
                            name: 'permissionTree',
                            component: PermissionTree
                        },
                    ]
                },
                {
                    path: '/core/permission/permissionTree',
                    name: 'permissionTree',
                    component: PermissionTree
                },
                {
                    path: '/core/permission/permissionList',
                    name: 'permissionList',
                    component: PermissionList
                },
                {
                    path: '/core/organize/organizeTree',
                    name: 'organizeTree',
                    component: OrganizeTree
                },
                {
                    path: '/core/user/userList',
                    name: 'userList',
                    component: UserList
                },
                {
                    path: '/core/organize/orgUserList',
                    name: 'orgUserList',
                    component: OrgUserList
                },
            ]
        },
        {
            path: '/weChatIndex',
            name: 'weChatIndex',
            component: WeChatFrame,
            children: [
                {
                    path: '/a1',
                    name: 'a1',
                    component: A1,
                },
                {
                    path: '/a2',
                    name: 'a2',
                    component: A2,
                },
                {
                    path: '/message',
                    name: 'message',
                    component: Message,
                }, {
                    path: '/my',
                    name: 'my',
                    component: My,
                }
            ]
        },
        {
            path: '/details',
            name: 'details',
            component: Details,
        },
        {
            path: '/weChatRegister',
            name: 'weChatRegister',
            component: WeChatRegister,
        }
    ]
})



